package a.g;

import a.c.e;
import a.c.m;
import a.c.w;
import a.f.cb;
import a.f.ed;
import a.f.fd;
import a.f.o;
import a.f.qc;
import a.h.bd;
import a.h.cc;
import a.h.dc;
import a.h.ec;
import a.h.kc;
import a.h.nc;
import a.h.s;
import a.h.z;
import a.i.p;
import a.j.ab;
import a.j.g;
import a.j.ig;
import a.j.tb;

import java.awt.*;

import a.j.ab;
import a.j.tb;
import a.i.p;
import a.c.w;

public class n
  extends h
{
  private static final String q = "DIRECTED_ORTHOGONAL_LAYOUTER";
  private static final String r = "LAYOUT";
  private static final String s = "USE_EXISTING_DRAWING_AS_SKETCH";
  private static final String t = "GRID";
  private static final String u = "RIGHT_TO_LEFT";
  private static final String v = "BOTTOM_TO_TOP";
  private static final String w = "LEFT_TO_RIGHT";
  private static final String x = "TOP_TO_BOTTOM";
  private static final String y = "ORIENTATION";
  private static final String[] z = { "TOP_TO_BOTTOM", "LEFT_TO_RIGHT", "BOTTOM_TO_TOP", "RIGHT_TO_LEFT" };
  private static final String A = "AUTO_GROUP_DIRECTED_EDGES";
  private static final String B = "EDGE_LABEL_MODEL";
  private static final String C = "EDGE_LABELING";
  private static final String D = "LABELING";
  private static final String E = "GENERIC";
  private static final String F = "NONE";
  private static final String G = "INTEGRATED";
  private static final String H = "FREE";
  private static final String I = "SIDE_SLIDER";
  private static final String J = "CENTER_SLIDER";
  private static final String K = "AS_IS";
  private static final String L = "BEST";
  private static final String M = "CONSIDER_NODE_LABELS";
  private static final String N = "IDENTIFY_DIRECTED_EDGES";
  private static final String O = "USE_AS_CRITERIA";
  private static final String P = "LINE_COLOR";
  private static final String Q = "TARGET_ARROW";
  private static final String R = "LINE_TYPE";
  private static final String S = "MINIMUM_FIRST_SEGMENT_LENGTH";
  private static final String T = "MINIMUM_LAST_SEGMENT_LENGTH";
  private static final String U = "MINIMUM_SEGMENT_LENGTH";
  private static final String[] V = { "NONE", "INTEGRATED", "GENERIC" };
  private static final String[] W = { "BEST", "AS_IS", "CENTER_SLIDER", "SIDE_SLIDER", "FREE" };
  public static boolean X;
  
  public n()
  {
    super("DIRECTED_ORTHOGONAL_LAYOUTER", "yFiles Layout Team", "Directed Orthogonal Layouter");
    d(true);
  }
  
  public dc j()
  {
    dc localdc = new dc(a());
    localdc.l("LAYOUT");
    localdc.a("GRID", 25).a(nc.y, new Integer(1));
    localdc.a("ORIENTATION", z, 0);
    localdc.a("USE_EXISTING_DRAWING_AS_SKETCH", false);
    cc localcc = new cc();
    localcc.a("OptionGroup.title", "IDENTIFY_DIRECTED_EDGES");
    Object localObject = localdc.a("USE_AS_CRITERIA", new String[] { "LINE_COLOR", "TARGET_ARROW", "LINE_TYPE" }, 0);
    localcc.a((ec)localObject);
    localObject = localdc.a("LINE_COLOR", Color.red, true);
    localcc.a((ec)localObject);
    kc localkc = new kc("TARGET_ARROW", ab.b().toArray(), ab.f);
    localkc.a(kc.z, new s());
    localkc.e(true);
    localdc.a(localkc);
    localcc.a(localkc);
    localkc = new kc("LINE_TYPE", a.j.c.b().toArray(), a.j.c.f);
    localkc.a(kc.z, new bd());
    localkc.e(true);
    localdc.a(localkc);
    localcc.a(localkc);
    z localz = new z(localdc);
    localz.a("USE_AS_CRITERIA", "LINE_COLOR", "LINE_COLOR");
    localz.a("USE_AS_CRITERIA", "TARGET_ARROW", "TARGET_ARROW");
    localz.a("USE_AS_CRITERIA", "LINE_TYPE", "LINE_TYPE");
    localdc.a("AUTO_GROUP_DIRECTED_EDGES", true);
    localz.a("USE_EXISTING_DRAWING_AS_SKETCH", Boolean.FALSE, "AUTO_GROUP_DIRECTED_EDGES");
    localdc.a("MINIMUM_FIRST_SEGMENT_LENGTH", 10.0D);
    localdc.a("MINIMUM_LAST_SEGMENT_LENGTH", 10.0D);
    localdc.a("MINIMUM_SEGMENT_LENGTH", 10.0D);
    localdc.l("LABELING");
    localcc = new cc();
    localz.a(localdc.a("EDGE_LABELING", V, 0), "NONE", localcc.a(localdc.a("EDGE_LABEL_MODEL", W, 0)), true);
    localcc.a(localdc.a("CONSIDER_NODE_LABELS", false));
    return localdc;
  }
  
  public void n()
  {
    int i = f.p;
    boolean bool = f.o;
    dc localdc = i();
    g localg = e();
    p local0 = null;
    if (localg.c(a.f.h.h.E) == null)
    {
      local0 = new p()
      {
        private final g val$graph;
        private final dc val$op;
        
        public boolean getBool(Object paramAnonymousObject)
        {
          int i = f.p;
          tb localtb = this.val$graph.t((a.c.d)paramAnonymousObject);
          Object localObject1;
          Object localObject2;
          if (i == 0) {
            if (this.val$op.j("USE_AS_CRITERIA").equals("LINE_COLOR"))
            {
              localObject1 = (Color)this.val$op.j("LINE_COLOR");
              localObject2 = localtb.A();
              if ((i != 0) || (localObject1 != null)) {
                if (i != 0) {}
              }
              return ((Color)localObject1).equals(localObject2);
            }
          }
          if (i == 0) {
            if (this.val$op.j("USE_AS_CRITERIA").equals("TARGET_ARROW"))
            {
              localObject1 = (ab)this.val$op.j("TARGET_ARROW");
              localObject2 = localtb.H();
              if ((i != 0) || (localObject1 != null)) {
                if (i != 0) {}
              }
              return localObject1.equals(localObject2);
            }
          }
          if (i == 0) {
            if (this.val$op.j("USE_AS_CRITERIA").equals("LINE_TYPE"))
            {
              localObject1 = (a.j.c)this.val$op.j("LINE_TYPE");
              localObject2 = localtb.D();
              if ((i != 0) || (localObject1 != null)) {
                if (i != 0) {}
              }
              return ((a.j.c)localObject1).equals(localObject2);
            }
          }
          return false;
        }
      };
      localg.a(a.f.h.h.E, local0);
    }
    a.c.k localk1 = null;
    a.c.k localk2 = null;
    a.c.n localn1 = null;
    a.c.n localn2 = null;
    if (localdc.g("AUTO_GROUP_DIRECTED_EDGES"))
    {
      localk1 = localg.c(ed.c);
      localk2 = localg.c(ed.d);
      localn1 = localg.C();
      localn2 = localg.C();
      localg.a(ed.c, localn1);
      localg.a(ed.d, localn2);
      a(localg, localn1, localn2, local0);
    }
    a.f.h.h localh = new a.f.h.h();
    a.f.h.k localk = localh.s();
    localk.a(localdc.f("MINIMUM_FIRST_SEGMENT_LENGTH"));
    localk.b(localdc.f("MINIMUM_LAST_SEGMENT_LENGTH"));
    localk.c(localdc.f("MINIMUM_SEGMENT_LENGTH"));
    localh.a(localdc.e("GRID"));
    localh.j(localdc.g("USE_EXISTING_DRAWING_AS_SKETCH"));
    cb localcb = (cb)localh.h();
    if (i == 0) {
      if (localdc.j("ORIENTATION").equals("TOP_TO_BOTTOM"))
      {
        localcb.a((byte)0);
        if (i != 0) {
          break label352;
        }
        if (!bool) {
          break label341;
        }
      }
    }
    if (i == 0) {
      if (localdc.j("ORIENTATION").equals("LEFT_TO_RIGHT"))
      {
        localcb.a((byte)1);
        if (i != 0) {
          break label352;
        }
        if (!bool) {
          break label341;
        }
      }
    }
    if (i == 0) {
      if (localdc.j("ORIENTATION").equals("BOTTOM_TO_TOP"))
      {
        localcb.a((byte)2);
        if (i != 0) {
          break label352;
        }
        if (!bool) {
          break label341;
        }
      }
    }
    if (i == 0)
    {
      if (localdc.j("ORIENTATION").equals("RIGHT_TO_LEFT")) {
        localcb.a((byte)3);
      }
      label341:
      if (i != 0) {}
    }
    else if (localdc.g("CONSIDER_NODE_LABELS"))
    {
      label352:
      localh.h(true);
    }
    String str = localdc.h("EDGE_LABELING");
    localh.i(str.equals("INTEGRATED"));
    localh.h(localdc.g("CONSIDER_NODE_LABELS"));
    if (i == 0) {
      if (!str.equals("NONE"))
      {
        a(str, localdc.h("EDGE_LABEL_MODEL"));
        if (i != 0) {
          break label463;
        }
        if (!bool) {
          break label449;
        }
      }
    }
    if (i == 0) {
      if (!localdc.g("CONSIDER_NODE_LABELS")) {
        localh.c(false);
      }
    }
    try
    {
      label449:
      a(localh, true);
      if (str.equals("GENERIC"))
      {
        label463:
        a.f.e.c localc = new a.f.e.c();
        localc.f(false);
        localc.g(true);
        localc.h(true);
        localc.a(new qc());
        localc.doLayout(localg);
      }
    }
    finally
    {
      if (i == 0)
      {
        if (localdc.g("AUTO_GROUP_DIRECTED_EDGES"))
        {
          localg.j(ed.c);
          localg.j(ed.d);
        }
      }
      else
      {
        if (i == 0) {
          if (localk1 != null) {
            localg.a(ed.c, localk1);
          }
        }
        if (localk2 != null) {
          localg.a(ed.d, localk2);
        }
        if (i == 0) {
          if (localn1 != null) {
            localg.a(localn1);
          }
        }
        if (localn2 != null) {
          localg.a(localn2);
        }
      }
      if (local0 != null) {
        localg.j(a.f.h.h.E);
      }
    }
  }
  
  void a(String paramString1, String paramString2)
  {
    int k = f.p;
    boolean bool = f.o;
    if ((k != 0) || (!paramString1.equals("NONE")))
    {
      if (k != 0) {
        break label41;
      }
      if (!paramString2.equals("AS_IS")) {}
    }
    else
    {
      return;
    }
    label41:
    byte b = 6;
    if (k == 0) {
      if (paramString2.equals("CENTER_SLIDER"))
      {
        b = 5;
        if ((k == 0) && (!bool)) {
          break label98;
        }
      }
    }
    if ((k != 0) || ((paramString2.equals("FREE")) || ((k != 0) || (paramString2.equals("BEST"))))) {
      b = 4;
    }
    label98:
    g localg = e();
    m localm = localg.w();
    label224:
    label246:
    do
    {
      if (!localm.e()) {
        break;
      }
      a.c.d locald = localm.a();
      tb localtb = localg.t(locald);
      int i = 0;
      do
      {
        ig localig;
        int j;
        do
        {
          if (i >= localtb.V()) {
            break;
          }
          localig = localtb.d(i);
          localig.e(b);
          j = localig.b().b();
        } while (bool);
        if (b == 5)
        {
          if (k != 0) {
            break label224;
          }
          if (j != 8)
          {
            a(localig, (byte)8);
            if (k != 0) {
              continue;
            }
            if (!bool) {
              break label246;
            }
          }
        }
        if (k == 0)
        {
          if (b == 6)
          {
            if (k != 0) {
              continue;
            }
            if (j == 8) {
              a(localig, (byte)32);
            }
          }
          i++;
        }
      } while (!bool);
      localm.f();
    } while (!bool);
  }
  
  void a(o paramo, a.c.n paramn1, a.c.n paramn2, a.c.k paramk)
  {
    int n = f.p;
    boolean bool = f.o;
    Object localObject1 = paramo.w();
    do
    {
      while (!bool)
      {
        if (!((m)localObject1).e()) {
          break;
        }
        paramn1.a(((m)localObject1).a(), null);
        paramn2.a(((m)localObject1).a(), null);
        ((m)localObject1).f();
      }
    } while (n != 0);
    localObject1 = new a.i.a.d(paramo);
    a.i.a.d locald = new a.i.a.d(paramo);
    w localw = paramo.v();
    label212:
    Object localObject2;
    label228:
    do
    {
      do
      {
        e locale1;
        do
        {
          if (!localw.e()) {
            break label313;
          }
          break label228;
          locale1 = localw.d();
          int k = 0;
          if (bool) {
            return;
          }
          m localm1 = locale1.n();
          do
          {
            if (!localm1.e()) {
              break;
            }
            if (bool) {
              break label212;
            }
            if (paramk.getBool(localm1.a()))
            {
              if (n != 0) {
                continue;
              }
              if (!localm1.a().g()) {
                k++;
              }
            }
            localm1.f();
          } while (!bool);
          ((a.i.a.d)localObject1).a(locale1, -k);
        } while (n != 0);
        int m = 0;
        localObject2 = locale1.m();
        do
        {
          if (!((m)localObject2).e()) {
            break label286;
          }
          if (bool) {
            break;
          }
          if (paramk.getBool(((m)localObject2).a()))
          {
            if (n != 0) {
              continue;
            }
            if (!((m)localObject2).a().g()) {
              m++;
            }
          }
          ((m)localObject2).f();
        } while (!bool);
        locald.a(locale1, -m);
        localw.f();
      } while (n != 0);
    } while (!bool);
    label286:
    label313:
    do
    {
      break label546;
      e locale2;
      m localm2;
      while ((n == 0) && (!localm2.e()))
      {
        if ((n != 0) || (((a.i.a.d)localObject1).a()) || ((n == 0) && (locald.a()))) {
          return;
        }
        int i = 0;
        int j = 0;
        if (n == 0) {
          if (!((a.i.a.d)localObject1).a()) {
            j = -((a.i.a.d)localObject1).f();
          }
        }
        if (n == 0) {
          if (!locald.a()) {
            i = -locald.f();
          }
        }
        if (i <= j) {
          break;
        }
        locale2 = locald.c();
        localm2 = locale2.m();
      }
      localObject2 = localm2.a();
      do
      {
        for (;;)
        {
          if (!bool) {
            if (n == 0)
            {
              if (paramn1.get(localObject2) == null)
              {
                if ((n != 0) || (n != 0)) {
                  break label529;
                }
                if (paramk.getBool(localObject2))
                {
                  if (n != 0) {
                    break label529;
                  }
                  if (!((a.c.d)localObject2).g())
                  {
                    paramn2.a(localObject2, locale2);
                    ((a.i.a.d)localObject1).d(((a.c.d)localObject2).e(), ((a.i.a.d)localObject1).b(((a.c.d)localObject2).e()) + 1);
                  }
                }
              }
              localm2.f();
              if (!bool) {
                break;
              }
              locale2 = ((a.i.a.d)localObject1).c();
              localm2 = locale2.n();
              if (!localm2.e()) {
                break label313;
              }
              localObject2 = localm2.a();
            }
          }
        }
      } while (bool);
      if (paramn2.get(localObject2) == null)
      {
        if (n != 0) {
          continue;
        }
        if (paramk.getBool(localObject2))
        {
          if (n != 0) {
            continue;
          }
          if (!((a.c.d)localObject2).g())
          {
            paramn1.a(localObject2, locale2);
            locald.c(((a.c.d)localObject2).f(), locald.b(((a.c.d)localObject2).f()) + 1);
          }
        }
      }
      localm2.f();
    } while (!bool);
    label529:
    label546:
    return;
  }
  
  static void a(ig paramig, byte paramByte)
  {
    fd localfd1 = paramig.b();
    if ((f.p != 0) || (localfd1.b() != paramByte))
    {
      fd localfd2 = new fd(localfd1);
      localfd2.b(paramByte);
      paramig.a(localfd2);
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.g.n

 * JD-Core Version:    0.7.0.1

 */